Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to master remaining items from 4.4 #11696

Merged
merged 40 commits into from
Aug 19, 2024

Conversation

Davidsastresas
Copy link
Member

@Davidsastresas Davidsastresas commented Jul 22, 2024

This PR brings to master some items that were pushed to 4.4 but were still missing in master. It includes:

New gimbal controls: #11264
Some aditional fixes and improvements: #11276
Some extra fixes: 4fc99bc 748d185 5218925 69b3ec2

I only tested the changes related to gimbal controls, and they seem to be working the same as in 4.4.

@julianoes, I realized your fixes to camera manager were not present in master, so I brought them from 4.4 too. I think it should be fine, but It would be good if you want to double check. Thanks!

@rmackay9, Even though I tested in SITL the gimbal controls it would be good if you can double check. Thanks!

The following is a list of the commits that were meant to be brought to master, indicating the ones present here as "done" and the ones not brought to this PR indicated:

not needed * 08d6c050c - (2 days ago) Updated GPS submodule - Julian Oes (HEAD -> Stable_V4.4, upstream/Stable_V4.4)
not needed * 17f7d8008 - (3 months ago) Update PX4 Firmware metadata Fri Apr 12 19:40:38 UTC 2024 - PX4BuildBot
not needed * 15bdfd5f1 - (6 weeks ago) Revert ".github: Don't upload to S3, just for this particular branch, see details:" - Julian Oes (tag: v4.4.0)
done * 8d72421a9 - (7 weeks ago) QGCCameraManager.cc: change log from qWarning to CameraManagerLog: - davidsastresas (tag: v4.4.0rc5)
done * c1a85b023 - (7 weeks ago) VehicleMapItem.qml: fix qml warning - davidsastresas
not needed * a2d7d1812 - (7 weeks ago) OfflineMap.qml: Fix menu - davidsastresas
already applied * f1ba395bf - (4 months ago) Using GST structure to confirm video decoding stream format. - IanBrace2
done * 9359fc4c1 - (7 weeks ago) QGeoMapReplyQGC: disable noisy warning - Julian Oes
done * 6eb0e4253 - (7 weeks ago) Camera: video stream request fixup - Julian Oes
done * 4b50ece3d - (7 weeks ago) QGeoMapReplyQGC: ignore SSL without OpenSSL 1.x - Julian Oes
not applied, .actions have changed * 750f1f224 - (7 weeks ago) CI: upload artifacts to release - Julian Oes
done * a02e74a47 - (7 weeks ago) Vehicle: fix unit tests after camera change - Julian Oes (tag: v4.4.0rc4)
done * f20f05e87 - (7 weeks ago) Camera: allow camera managed by an autopilot - Julian Oes
done * b02c0dd17 - (7 weeks ago) Camera: switch to new REQUEST_MESSAGE commands - Julian Oes
done * 9b00dc039 - (8 weeks ago) qmake: fix Android version code for RCs - Julian Oes
not needed * a753a8684 - (8 weeks ago) VideoReceiver: bump gstreamer version - Julian Oes (tag: v4.4.0rc3)
not needed * 76cf18080 - (9 weeks ago) .github: fix mac build - davidsastresas (tag: v4.4.0rc2)
not needed * 345ddba88 - (9 weeks ago) .github: Update android gstreamer to 1.18.6: - davidsastresas
done * efa109cfc - (9 weeks ago) GimbalController: Limit how fast we send gimbal status message request: - davidsastresas
done * dd166855d - (9 weeks ago) GimbalController: start handshake only after parameters are donwloaded: - davidsastresas
not needed * ab7c716b0 - (3 months ago) .github: Don't upload to S3, just for this particular branch, see details: - davidsastresas (tag: v4.4.0rc1)
not needed * d9df61e7a - (3 months ago) .github/android_release.yml: remove ext11 to fix build - davidsastresas
not needed * 404545fae - (3 months ago) Revert "MainRootWindow.qml: remove unused viewSwitch() function" - Julian Oes
done * 00fbb1a73 - (3 months ago) SendMavCommandWithSignallingTest.cc: ignore MAV_CMD_REQUEST_MESSAGE: - davidsastresas
done * 7f6a912f5 - (3 months ago) RequestMessageTest.cc: disable vehicle gimbal controller on this test: - davidsastresas
done * 56e05f4a5 - (3 months ago) Vehicle: independent function to delete gimbal controller, needed for tests: - davidsastresas
done * ec2273666 - (4 months ago) FlyViewVideo.qml, OnScreenGimbalController.qml: fix conflict with tracking feature after rebase - davidsastresas
done * 9d3125242 - (4 months ago) GimbalIndicator.qml: Add Acquire/release control button - davidsastresas
done * 390571fbf - (4 months ago) GimbalControllerSettings: Add setting to show or not Acquire/release control button - davidsastresas
done * 29003c4f9 - (4 months ago) GimbalController.cc: send NAN instead of 0 when rates are not used - davidsastresas
done * 24481c888 - (4 months ago) FlyViewMap.qml: connect roilocationitem to vehicle roiCoordChanged: - davidsastresas
done * 23dfa6570 - (4 months ago) Vehicle: add roiCoordChanged signal: - davidsastresas
done * 02370dee9 - (4 months ago) FlyViewMap.qml: ROI edit click area ocupying all the label: - davidsastresas
done * 78ee54ee9 - (4 months ago) Joystick: fix gimbal control and add some new button actions for gimbal control - davidsastresas
done * eb36c29e7 - (4 months ago) InstrumentValueIcons: add 2 new icons for gimbal telemetry, artwork by Alex de la Torre - davidsastresas
done * 96292f0d3 - (4 months ago) FlyviewVideo.qml: add OnScreenGimbalController for gimbal mouse actions control - davidsastresas
done * 91b050d88 - (4 months ago) OnScreenGimbalController.qml: first commit, process onscreen mouse actions for gimbal control - davidsastresas
done * b9f23b375 - (4 months ago) VehicleMapItem.qml: add gimbal yaw indicator over map - davidsastresas
done * 3329ef8d1 - (4 months ago) FirmwarePlugin.cc: add gimbalIndicator to toolIndicators - davidsastresas
done * e88303f61 - (4 months ago) GimbalIndicator.qml: first commit - davidsastresas
done * 26ef825a0 - (4 months ago) qgcresources.qrc: add new icon for gimbal indicator - davidsastresas
done * 5cc5b76f6 - (4 months ago) resources: add new icon for gimbal indicator, artwork by Alex de la Torre - davidsastresas
done * c0d70cbc8 - (4 months ago) Vehicle: add gimbalController, and move gimbal functionality there: - davidsastresas
done * 13ed85703 - (4 months ago) qgroundcontrol.pro: add GimbalController and GimbalControllerSettings - davidsastresas
done * 0e4435f71 - (4 months ago) QGCApplication.cc: add GimbalController and register to qml - davidsastresas
done * e44445ce7 - (4 months ago) GimbalController and GimbalControllerSettings: first commit - davidsastresas
not needed * 6e152ec14 - (4 months ago) FlyViewMap.qml: fix previous c1364dad3 commit after backport to 4.3 from master: - davidsastresas
not needed * 3c39c108b - (5 months ago) Add ROI editing menu - Don Gagne
not needed * e1d4b61c2 - (5 months ago) Add support to pass click position through signal - Don Gagne
not needed * 72e9d7491 - (5 months ago) Remove ROI Indicator from toolbar - Don Gagne
done * 607879a51 - (4 months ago) ToolStrip.qml: expose fontSize for ToolStripHoverButton - davidsastresas
done * c2009ef5e - (4 months ago) MainRootWindow.qml: indicator popup, allow to not dim background - davidsastresas
done * 156be6678 - (4 months ago) QGCButton.qml: add fontWeight property - davidsastresas

@Davidsastresas Davidsastresas marked this pull request as draft July 22, 2024 16:59
@Davidsastresas
Copy link
Member Author

Davidsastresas commented Jul 22, 2024

It seems CI is failing because I missed to update the CMake files. I might have some time to fix that in the following days, but if anybody familiar with CMake wants to help It would be great. I think it is only needed for the new GimbalController class.

@julianoes
Copy link
Contributor

Thanks @Davidsastresas. Sounds like we should do a v4.4.1 release soon.

@rmackay9
Copy link

Great to see this!

of course I'll help with testing and if we want to do that 4.4.1 release then I'll help organise that like last time

@HTRamsey
Copy link
Collaborator

I suppose we don't need QGeoTiledMapReplyQGC::setIgnoreSSLErrorsIfNeeded in Qt6 since it already uses OpenSSL3, but it doesn't hurt to have it either

@Davidsastresas
Copy link
Member Author

I suppose we don't need QGeoTiledMapReplyQGC::setIgnoreSSLErrorsIfNeeded in Qt6 since it already uses OpenSSL3, but it doesn't hurt to have it either

Good catch! At first I thought the same, but then I realized it is useful too for the other way around, for Qt6 in systems that have OpenSSL1 instead. I think it doesn't hurt either, so I would vote for leaving it there. Thanks for the review!

@HTRamsey
Copy link
Collaborator

@Davidsastresas Fixed CMake

@Davidsastresas
Copy link
Member Author

@Davidsastresas Fixed CMake

Amazing, thank you very much! Let's give it a few days in case Julian and Randy come up with some modification needed before merging. I will remove the draft label too. Thank you!

@Davidsastresas Davidsastresas marked this pull request as ready for review July 24, 2024 08:06
@rmackay9
Copy link

rmackay9 commented Aug 1, 2024

I tried to test this today on my Windows machine and it wouldn't even start. I used the installer found here.

I suspect that the issue is not actually related to this PR so I tried to install the "Daily Build" but was not able to find an installer. The link on the Daily Builds page seems broken (click here to see what I mean)

@Davidsastresas
Copy link
Member Author

Davidsastresas commented Aug 1, 2024

Sorry to hear that @rmackay9, if you had your previous build environment setup for QGC 4.4, for master you need qt6, and I am not sure if for windows you need different visual studio toolchain too. There are lots of changes on the build setup right now for QGC 4.4 vs master.

The builds corresponding to this PR should be here ( I found them searching manually in actions ):
Linux: https://github.com/mavlink/qgroundcontrol/actions/runs/10068063218
macos: https://github.com/mavlink/qgroundcontrol/actions/runs/10068063221
windows: https://github.com/mavlink/qgroundcontrol/actions/runs/10068063226
android: https://github.com/mavlink/qgroundcontrol/actions/runs/10068063231

Let me know if that fixes the situation for the moment!

EDIT - I see you used the build I recommended above, sorry I don't know why I thought you were trying to build from source. How was it not even starting, did it report something or any kind of error popup? @HTRamsey, do you know if master is supposed to be working fine in windows? Thanks!

@HTRamsey
Copy link
Collaborator

HTRamsey commented Aug 1, 2024

Oh you'll have to try again on the latest build because of this #11678, it works fine now.

@rmackay9
Copy link

rmackay9 commented Aug 1, 2024

Hi @HTRamsey,

Is there a link to a Windows installer for latest? I can't find one that works (see my comment above).

I wonder if this PR should be rebased on master to pickup PR 11678?

@HTRamsey
Copy link
Collaborator

HTRamsey commented Aug 1, 2024

You can always just grab it from the latest run. But yeah I guess the daily windows link needs to be updated.

Also @Davidsastresas you said you found those links manually from actions, if I'm understanding you correctly just FYI you can also just click details on the builds results below where it says All checks have passed.

Capitals shouldn't matter in a URL but I noticed the installer has an upper case 'i' while the link & docs have it as lower case. Could that be why the download isn't working?

@rmackay9
Copy link

rmackay9 commented Aug 1, 2024

Hi @HTRamsey @Davidsastresas,

Thanks for that. So the daily build using this installer does work and I think this means that this PR does not but hopefully that is just because it needs to be rebased (I'm guessing of course)

@HTRamsey
Copy link
Collaborator

HTRamsey commented Aug 1, 2024

@Davidsastresas a followup to my QGeoMapReplyQGC comment, you can just use QGCFileDownload::setIgnoreSSLErrorsIfNeeded which is the exact same function.

@Davidsastresas
Copy link
Member Author

Davidsastresas commented Aug 4, 2024

Also @Davidsastresas you said you found those links manually from actions, if I'm understanding you correctly just FYI you can also just click details on the builds results below where it says All checks have passed.

@HTRamsey For some reason doing that I can only see the job, but not the artifact to download! Does it work for you to download the artifact too? I am using google chrome in case that matters.

Thanks for fixing build for Windows. I haven't had the chance to build because I need to setup cmake, I was still using qmake, it is probably not a big deal but I need to spare an hour or two to understand everything for the next time.

I rebased to master. @rmackay9 after it finishes it should be ready for you to test. Thanks!

@Davidsastresas
Copy link
Member Author

Davidsastresas commented Aug 4, 2024

setIgnoreSSLErrorsIfNeeded

@HTRamsey Please note the branch is in mavlink repo, so you can directly push commits to it. Please feel free to change that if you see fit. As it is now it works for me on a machine with OpenSSL 1 on Ubuntu 20.04. Thanks!

@Davidsastresas
Copy link
Member Author

@julianoes for awareness, I just pushed here your commits from this PR #11706 So hopefully we can keep master updated with what we are doing in QGC 4. Thanks!

@HTRamsey
Copy link
Collaborator

HTRamsey commented Aug 5, 2024

@Davidsastresas after clicking details you have to click Summary at the top left

@Davidsastresas
Copy link
Member Author

@Davidsastresas after clicking details you have to click Summary at the top left

No way.... I've been for ages thinking it was a github bug. Thank you for enlightening me! :)

@rmackay9
Copy link

rmackay9 commented Aug 8, 2024

I tested this today on my windows PC and it seems to work fine with some issues found which I think are also in QGC Daily.

I connected my desktop CubeRed + SiyiA8 to my PC via USB and confirmed the following worked

  1. gimbal control menu appeared (but only after having connected with MP or manually setting the SR0_xxx parameters)
  2. "Center and "Tilt 90" buttons worked
  3. Yaw Lock / Yaw Follow worked correctly. In particular when in Yaw Lock, the gimbal maintained its heading regardless of the autopilot's heading. In Yaw Follow the gimbal's yaw rotated with the vehicle
  4. Click-to-point on the video stream resulted in the gimbal pointing to a reasonable angle (I did not have the FOV set perfectly but it seemed correct)
  5. "Point Home" and "Retract" buttons worked

By the way, not related directly to this testing but this gave me the opportunity to test the camera controls (FYI @DonLakeFlyer):

  • The zoom slider worked!
  • The take-picture button did not work sadly
  • The record video control was not visible

Also not related to this PR but it seems that QGC Daily is not proactively requesting data from the autopilot. It seems to be passively waiting for the drone to start sending mavlink messages. This seems like a change in behaviour vs QGC4.4. I guess it is intentional? BTW, I think that AP obeys the mavlink spec and we've documented here on this AP wiki page how GCSs, companion computers can request data be sent by the autopilot which includes three basic methods:

  1. Using SRx Parameters
  2. Using REQUEST_DATA_STREAM
  3. Using SET_MESSAGE_INTERVAL

Copy link

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done my testing and it seems to work just like in QGC4.4

Thanks again for this great enhancement!

@Davidsastresas
Copy link
Member Author

Davidsastresas commented Aug 9, 2024

Thanks @rmackay9 for the confirmation. I will hold on a couple days more, as we found a bug that was preventing AP to work correctly on that "point home" action, so next week I will add that and merge this if @julianoes is alright with the changes.

Regarding the default rates, indeed the default behavior changed vs 4.4, but you can change the setting so QGC asks the rates to the autopilot, here:
Screenshot from 2024-08-09 16-51-59

The difference is that this setting was enabled by default in 4.4, but it is not by default in master.

Is this super problematic for AP? I thought by default in AP we had some kind of default for those SRX parameters. Let me know your thoughts!

@julianoes
Copy link
Contributor

@Davidsastresas ok, so we should disable it again in v4.4? PX4 has some default rates. AP requires it to be configured, right?

@rmackay9
Copy link

Hi @Davidsastresas,

Thanks for the feedback on the rates. I think it will be a large problem for AP copter users. Copter does not set the stream rates by default (Plane and Rover do). So if possible I think for AP users QGC should ask for the streams it wants by default

Davidsastresas and others added 26 commits August 18, 2024 05:51
After latest commits in indicators rework, this was broken.
Most of the new indicators use the new drawer mechanism instead,
so probably it went unnotticed because of this
…y Alex de la Torre

Co-authored-by: davidsastresas <[email protected]>
Co-authored-by: alexdelatorre <[email protected]>
before this commit it was ocupying only the missionitemindex label,
which is very small. Now it takes into account the are with the label
as well
this allows for ROI commanded elsewhere than clicking on map
( like gimbal panel point home action ) to show the ROI indicator
on map
Instead of setting manually the roilocationitem coordinate in
flyviewmap.qml, we rely instead on the new signal from vehicle.
This way, changes in roi in other parts of the app than map clicks,
like gimbal controls point home, will make the roi indicator appear
… tests:

RequestMessageTest implementation collides with how gimbal controller works.
Gimbal controller will request some messages when hearbeat is received, to
try to discover new gimbals, and it messes with this particular test, so this
way we can disable gimbal manager just for this test
As it also sends request messages and it collides with the
requests of this test
gimbal controller sends some message requests when receiving a
hearbeat, and the cmd results collide with this test, so we filter
out MAV_CMD_REQUEST_MESSAGE from gimbal controller
Could interfere with parameter download on Herelink slower link
There was no wait between such requests, and Ardupilot was failing
to detect the handshake some times
The used commands like REQUEST_CAMERA_SETTINGS and
REQUEST_CAMERA_INFORMATION are deprecated. Therefore, we should
gradually try to move to the new REQUEST_MESSAGE commands.

This commit does so by sending REQUEST_MESSAGE by default but falling
back to the previous commands on the second try and every other retry
after that.
By querying autopilot for the CAMERA_INFORMATION message, we allow an
autopilot to be a proxy for a MAVLink or non-MAVLink camera.

The idea is similar to a gimbal manager implemented by an autopilot.
Since we no longer request cameras to have specific camera component IDs
but allow the autopilot to "be" a camera as well, we need to adjust the
unit tests to account for that.
This fixes getting the video stream.
This made sense when we were not taking compid autopilot into account,
but now it will log this every vehicle connection if it isn't emulating
a mavlink camera
Otherwise, we potentially work with garbage.
This changes how the found gimbals are referenced. Instead of only using
the gimbal device ID for the gimbal map, we now also use the gimbal
manager compid.

This assumes that it is valid to have more than one gimbal manager with
non-MAVLink gimbals attached, which means the gimbal_device_id would
clash in that case, e.g. both would be 1.

Therefore, we use the gimbal manager compid as well as the associated
gimbal_device_id as the map key.
We should use the new yaw value, not the previous one when calculating
the missing frame.
We shouldn't just send the commands to the vehicle because the gimbal
manager might be implemented on any component, not just the autopilot.
@HTRamsey HTRamsey force-pushed the master_improve_gimbal_control branch from 28ee027 to af06849 Compare August 18, 2024 09:56
@Davidsastresas Davidsastresas merged commit 0bad57e into master Aug 19, 2024
8 checks passed
@Davidsastresas Davidsastresas deleted the master_improve_gimbal_control branch August 19, 2024 12:04
@Davidsastresas
Copy link
Member Author

Davidsastresas commented Aug 19, 2024

Thanks @DonLakeFlyer, it seems @HTRamsey did the rebase yesterday ( thank you! ) and everything was clear to merge, so I went ahead.

As far as I know, this should leave master with all the features 4.4 currently has. We can follow on that other thread about the default stream rates issue later.

thank you everybody!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants